﻿using Rabbit.Contracts.Interface;
using Rabbit.Domain.Entity;
using Rabbit.Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rabbit.Service
{
    public class ButcherService : IButcherService
    {
        private readonly IButcherRepository _butcherRepository;
        public ButcherService(IButcherRepository butcherRepository)
        {
            _butcherRepository= butcherRepository;
        }

        

        /// <summary>
        /// 添加屠宰
        /// </summary>
        /// <param name="butcher"></param>
        /// <returns></returns>
        public int GetButcherAdd(Butcher butcher)
        {
            return _butcherRepository.GetButcherAdd(butcher);
        }

        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public dynamic GetButcherFind(int id)
        {
           return _butcherRepository.GetButcherFind(id);
        }

        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public List<Butcher> GetButcherShow(int id)
        {
           return _butcherRepository.GetButcherShow(id);
        }

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="butcher"></param>
        /// <returns></returns>
        public int GetButcherXiu(Butcher butcher)
        {
            return _butcherRepository.GetButcherXiu(butcher);
        }

      
        /// <summary>
        /// 省
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public List<province> GetProvince()
        {
            return _butcherRepository.GetProvince();
        }

        /// <summary>
        /// 市
        /// </summary>
        /// <param name="provinceid"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public List<city> GetCitie(int provinceid)
        {
            return _butcherRepository.GetCitie(provinceid);
        }

        /// <summary>
        /// 区
        /// </summary>
        /// <param name="cityid"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public List<area> GetArea(int cityid)
        {
            return _butcherRepository.GetArea(cityid);
        }

        /// <summary>
        /// 屠宰显示
        /// </summary>
        /// <returns></returns>
        public List<Tcompany> GetTcompanies()
        {
            var list=_butcherRepository.GetTcompanies();
            return list;
        }

        /// <summary>
        /// 屠宰反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public dynamic GetTcompanyFind(int id)
        {
            var list=_butcherRepository.GetTcompanyFind(id);
            return list;
        }

        /// <summary>
        /// 屠宰修改
        /// </summary>
        /// <param name="tcompany"></param>
        /// <returns></returns>
        public int GetTcompanyXiu(Tcompany tcompany)
        {
            var list=_butcherRepository.GetTcompanyXiu(tcompany);
            return list;
        }
    }
}
